package io.rehuo.modules.app.enums;

import lombok.Getter;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;

/**
 * @author shiguang on 2022/9/15 15:46
 */
@Getter
public enum SmsTemplateType {

    /**
     * 验证码
     */
    VERIFICATION_CODE("verification_code","验证码"),

    /**
     * 待提现
     */
    WAIT_WITHDRAWN("wait_withdrawn","待提现"),

    /**
     * 放款成功
     */
    PAY_SUCCESS("pay_success","待提现"),
    /**
     * 到期前一天
     */
    EXPIRE_DAY_BEFORE_ONE("expire_day_before_one","到期前一天"),
    /**
     * 到期
     */
    EXPIRE_DAY_BEFORE("expire_day_before","到期当天"),
    /**
     * 还款成功
     */
    PAYMENT_SUCCESS("payment_success","还款成功"),

    /**
     * 逾期第一天
     */
    OVERDUE_ONE_DAY("overdue_one_day","逾期第一天"),
    ;

    private final String code;
    private final String info;

    SmsTemplateType(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public String getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static List<HashMap<String, String>> getList() {
        List<HashMap<String, String>> list = new ArrayList<>();
        for (SmsTemplateType smsTemplateType : EnumSet.allOf(SmsTemplateType.class)) {
            HashMap<String, String> map = new HashMap<>();
            map.put("code", smsTemplateType.code);
            map.put("name", smsTemplateType.info);
            list.add(map);
        }
        return list;
    }
}
